Skip to content

feat(chat): render native Twitch GIFs and optional GIF links - #3

Merged
fabianzimber merged 2 commits into
mainfrom
feat/chat-gifs
Oct 14, 2026
Merged

fabianzimber merged 2 commits into
mainfrom
feat/chat-gifs

Conversation

@fabianzimber

Copy link
Copy Markdown
Member

Twitch's native GIF keyboard messages currently appear as text in the overlay. Render their GIFs inline using the documented IRC gifs ranges and preserve the complete media URL. Add two independent configurator/link options: native Twitch GIFs are on by default (gifs=0 disables them); direct GIPHY/Tenor image links are off by default (giflinks=1 enables them). Share-page URLs remain text.

Both paths use one visible-only loader, fit within 320 × 240 pixels and the overlay width, and fall back to the original text on failure. Allow only HTTPS GIF files on the specified provider image hosts, reject redirects, omit credentials/referrers, and use cache: no-store. Bound downloads to 5 MiB/10 seconds and validate GIF containers, dimensions and frame budgets before rendering. Leaving the viewport, fading, moderation and component disposal abort downloads and remove image elements/revoke blob URLs; final memory reclamation remains browser-managed. Update the option/host documentation and both privacy policies.

Validation:

  • pnpm check and pnpm exec biome ci pass.
  • pnpm build passes, including all five prerendered pages.
  • Chromium 154 with controlled animated GIF responses: IRC-to-image flow with the supplied GIPHY URL unchanged, animation, narrow layouts, light/dark backgrounds, independent defaults, GIPHY/Tenor links, error fallback, lazy loading, moderation, fade cleanup, and cancellation before a response completes. No browser runtime errors.
  • Live CDN responses could not be checked because this environment blocks GIPHY/Tenor hosts. Firefox/WebKit/OBS were not run locally.

Closes #2.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ fa48771 2026-10-14T13:16:03.981Z Visit the dashboard ↗

@fabianzimber
fabianzimber merged commit d4caa99 into main Oct 14, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support GIFs in the embedded chat

1 participant